<?php
header("Content-type:text/html;charset=utf-8");
ini_set('display_errors', '1');
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
ignore_user_abort(true); 
@ini_set( "memory_limit", "512M" );
@ini_set( "max_execution_time", 60); 
@set_time_limit(60);
define('DI',DIRECTORY_SEPARATOR);
date_default_timezone_set('Asia/Shanghai');
session_start();
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" >
	<head>
		<meta name="viewport" content="width=device-width" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>HT panle(小河宝塔(河塔)主机控制面板) &rsaquo; 安装</title>
		<style>
			.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:0;border-style:none;padding:0}.wp-core-ui .button-group.button-large .button,.wp-core-ui .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button-group.button-small .button,.wp-core-ui .button.button-small{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button-group.button-hero .button,.wp-core-ui .button.button-hero{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active,.wp-core-ui .button:focus{outline:0}.ie8 .wp-core-ui .button-link:focus{outline:#5b9dd9 solid 1px}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus,.wp-core-ui input[type=reset]:hover{background:0;border:0;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button-link{border:0;background:0;outline:0;cursor:pointer}.wp-core-ui .button-secondary:focus,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button.hover,.wp-core-ui .button:focus,.wp-core-ui .button:hover{background:#fafafa;border-color:#999;color:#23282d}.wp-core-ui .button-link:focus,.wp-core-ui .button-secondary:focus,.wp-core-ui .button.focus,.wp-core-ui .button:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-secondary:active,.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button:active{background:#eee;border-color:#999;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button.active:focus{-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-disabled,.wp-core-ui .button-secondary.disabled,.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button.disabled,.wp-core-ui .button:disabled,.wp-core-ui .button[disabled]{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#00a0d2;border-color:#0073aa;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#0091cd;border-color:#0073aa;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#0073aa;border-color:#005082;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;-webkit-border-radius:0;border-radius:0;margin-right:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}
			.wp-core-ui .button-group>.button:first-child{-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.wp-core-ui .button-group>.button:last-child{-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.wp-core-ui .button-group>.button:focus{position:relative;z-index:1}@media screen and (max-width:782px){.wp-core-ui .button,.wp-core-ui .button.button-large,.wp-core-ui .button.button-small,a.preview,input#publish,input#save-post{padding:6px 14px;line-height:normal;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}#media-upload.wp-core-ui .button{padding:0 10px 1px;height:24px;line-height:22px;font-size:13px}.media-frame.mode-grid .bulk-select .button{margin-bottom:0}.wp-core-ui .save-post-status.button{position:relative;margin:0 14px 0 10px}.wp-core-ui.wp-customizer .button{padding:0 10px 1px;font-size:13px;line-height:26px;height:28px;margin:0;vertical-align:inherit}.interim-login .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');unicode-range:U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');unicode-range:U+0102-0103,U+1EA0-1EF1,U+20AB}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');unicode-range:U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');unicode-range:U+0370-03FF}
			@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');unicode-range:U+0102-0103,U+1EA0-1EF1,U+20AB}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');unicode-range:U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');unicode-range:U+0102-0103,U+1EA0-1EF1,U+20AB}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhgVThLs8Y7ETJzDCYFCSLE.woff2) format('woff2');unicode-range:U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxpiMaisvaUVUsYyVzOmndek.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxrBAWGjcah5Ky0jbCgIwDB8.woff2) format('woff2');unicode-range:U+1F00-1FFF}
			@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxv14vlcfyPYlAcQy2UfDRm4.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxqfJul7RR1X4poJgi27uS4w.woff2) format('woff2');unicode-range:U+0102-0103,U+1EA0-1EF1,U+20AB}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxqvyPXdneeGd26m9EmFSSWg.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),local('OpenSansLight-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxko2lTMeWA_kmIyWrkNCwPc.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');unicode-range:U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBkbcKLIaa1LC45dFaAfauRA.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBmo_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBr6up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');unicode-range:U+0102-0103,U+1EA0-1EF1,U+20AB}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBiYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),local('OpenSans-Italic'),url(https://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBo4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxmgpAmOCqD37_tyH_8Ri5MM.woff2) format('woff2');unicode-range:U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxsPNMTLbnS9uQzHQlYieHUU.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
			@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxgyhumQnPMBCoGYhRaNxyyY.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhUVAXEdVvYDDqrz3aeR0Yc.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxlf4y_3s5bcYyyLIFUSWYUU.woff2) format('woff2');unicode-range:U+0102-0103,U+1EA0-1EF1,U+20AB}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxnywqdtBbUHn3VPgzuFrCy8.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),local('OpenSans-SemiboldItalic'),url(https://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxl2umOyRU7PgRiv8DXcgJjk.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}a img,abbr{border:0}#logo a,a{text-decoration:none}#logo a,.form-table th p,h1{font-weight:400}html{background:#f1f1f1;margin:0 20px}body{background:#fff;color:#444;font-family:"Open Sans",sans-serif;margin:140px auto 25px;padding:20px 20px 10px;max-width:700px;-webkit-font-smoothing:subpixel-antialiased;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13)}a{color:#0073aa}a:hover{color:#00a0d2}h1{border-bottom:1px solid #dedede;clear:both;color:#666;font-size:24px;margin:30px 0;padding:0 0 7px}h2{font-size:16px}dd,dt,li,p{padding-bottom:2px;font-size:14px;line-height:1.5}.code,code{font-family:Consolas,Monaco,monospace}input,submit,textarea{font-family:"Open Sans",sans-serif}dl,ol,ul{padding:5px 5px 5px 22px}abbr{font-variant:normal}label{cursor:pointer}#logo{margin:6px 0 14px;border-bottom:0;text-align:center}#logo a{background-image:url(https://dn-idcswap.qbox.me/install/image/logo.png);background-image:none,url(https://dn-idcswap.qbox.me/install/image/logo.png);background-position:center top;background-repeat:no-repeat;color:#999;height:84px;font-size:20px;line-height:1.3em;margin:-130px auto 25px;padding:0;text-indent:-9999px;outline:0;overflow:hidden;display:block}#pass1-text,.pw-weak,.show-password #pass1{display:none}.step{margin:20px 0 15px}.step,th{text-align:left;padding:0}.language-chooser.wp-core-ui .step .button.button-large{height:36px;vertical-align:middle;font-size:14px}.form-table td,.form-table th{font-size:14px;padding:10px 20px 10px 0;vertical-align:top}textarea{border:1px solid #dfdfdf;width:100%;box-sizing:border-box}#pass-strength-result,textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px}.form-table th{text-align:left;width:140px}.form-table code{line-height:18px;font-size:14px}.form-table p{margin:4px 0 0;font-size:11px}.form-table input{line-height:20px;font-size:15px;padding:3px 5px;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.form-table input[type=email],.form-table input[type=password],.form-table input[type=text],.form-table input[type=url]{width:206px}.form-table.install-success td{vertical-align:middle;padding:16px 20px 16px 0}.form-table.install-success td p{margin:0;font-size:14px}.form-table.install-success td code{margin:0;font-size:18px}#error-page{margin-top:50px}#error-page p{font-size:14px;line-height:18px;margin:25px 0 20px}#error-page code,.code{font-family:Consolas,Monaco,monospace}.wp-hide-pw>.dashicons{line-height:inherit}#pass-strength-result{background-color:#eee;border:1px solid #ddd;color:#23282d;margin:-2px 5px 5px 0;padding:3px 5px;text-align:center;width:218px;box-sizing:border-box;opacity:0}#pass-strength-result.short{background-color:#f1adad;border-color:#e35b5b;opacity:1}#pass-strength-result.bad{background-color:#fbc5a9;border-color:#f78b53;opacity:1}
			#pass-strength-result.good{background-color:#ffe399;border-color:#ffc733;opacity:1}#pass-strength-result.strong{background-color:#c1e1b9;border-color:#83c373;opacity:1}#pass1-text.short,#pass1.short{border-color:#e35b5b}#pass1-text.bad,#pass1.bad{border-color:#f78b53}#pass1-text.good,#pass1.good{border-color:#ffc733}#pass1-text.strong,#pass1.strong{border-color:#83c373}.message{border:1px solid #c00;padding:.5em .7em;margin:5px 0 15px;background-color:#ffebe8}#admin_email,#dbhost,#dbname,#pass1,#pass2,#prefix,#pwd,#uname,#user_login{direction:ltr}.show-password #pass1-text{display:inline-block}.form-table span.description.important{font-size:12px}.rtl input,.rtl submit,.rtl textarea,body.rtl{font-family:Tahoma,sans-serif}.language-chooser select,:lang(he-il) .rtl input,:lang(he-il) .rtl submit,:lang(he-il) .rtl textarea,:lang(he-il) body.rtl{font-family:Arial,sans-serif}@media only screen and (max-width:799px){body{margin-top:115px}#logo a{margin:-125px auto 30px}}@media screen and (max-width:782px){.form-table{margin-top:0}.form-table td,.form-table th{display:block;width:auto;vertical-align:middle}.form-table th{padding:20px 0 0}.form-table td{padding:5px 0;border:0;margin:0}input,textarea{font-size:16px}.form-table span.description,.form-table td input[type=text],.form-table td input[type=email],.form-table td input[type=url],.form-table td input[type=password],.form-table td select,.form-table td textarea{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block;max-width:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}body.language-chooser{max-width:300px}.language-chooser select{padding:8px;width:100%;display:block;border:1px solid #ddd;background-color:#fff;color:#32373c;font-size:16px;font-weight:400}.language-chooser p{text-align:right}.screen-reader-input,.screen-reader-text{position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.spinner{background:url(../images/spinner.gif) no-repeat;-webkit-background-size:20px 20px;background-size:20px 20px;visibility:hidden;opacity:.7;filter:alpha(opacity=70);width:20px;height:20px;margin:2px 5px 0}.step .spinner{display:inline-block;margin-top:8px;margin-right:15px;vertical-align:top}.button-secondary.hide-if-no-js,.hide-if-no-js{display:none}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.spinner{background-image:url(../images/spinner-2x.gif)}}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;white-space:pre-wrap}
		</style>
	</head>
	<body class="wp-core-ui"><h1 id="logo"><a href="http://htpanel.ililil.top/" tabindex="-1">htpanel</a></h1>
	
<?php 


$xpath1=dirname(__FILE__);
$xpath2=$xpath1.'/temp';
$xpath3=$xpath2.'/*';

function hqxx(){
	$ret=@file_get_contents("temp/default.db");
	if(empty($ret)) return  [];
	$db = new SQLite3('temp/default.db');
	if(!$db) die('数据库链接出错'.$db->lastErrorMsg().'....'.time());
	$sql = 'SELECT * FROM "config"';
	$ret = $db->query($sql);
	$row = $ret->fetchArray(SQLITE3_ASSOC);
	return  [$row['webserver'], $row['mysql_root']];
	
}
function session_r($name){
	return $_SESSION[$name];
}
function session_w($name,$nr){
	$_SESSION[$name]=$nr;
}
function session_d($name,$nr){
	$_SESSION[$name]=null;
	unset($_SESSION[$name]);
}

function q_domain(){
	return $_SERVER['SERVER_NAME'];
}
function q_mb_domain(){
	$ret=@file_get_contents("temp/domain.conf");
	if(empty($ret)) return '127.0.0.1';
	return $ret;
}
function q_mb_port(){
	$ret=@file_get_contents("temp/port.pl");
	if(empty($ret)) return '8888';
	return $ret;
}
function q_api(){
	$ret=json_decode(@file_get_contents("temp/api.json"),1);
	return $ret['token'];
}
function q_ip(){
	$ret=json_decode(@file_get_contents("https://api.ipify.org/?format=json"),1);
	return $ret['ip'];
}
function db_install($name,$pass){
	$db = new mysqli('127.0.0.1', $name, $pass, $name, 3306);
	if ($db->connect_errno) die(print_r(array('数据库链接出错',$db->connect_errno,$db->connect_error)));
	//db_query("SET sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';");
	//db_query("set time_zone = '+8:00';");
	//db_query("SET NAMES UTF8");
	
	
	//$sqlstr="CREATE TABLE IF NOT EXISTS `host` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) DEFAULT NULL, `domain` varchar(50) DEFAULT NULL, `password` varchar(50) DEFAULT NULL, `ftppass` varchar(50) DEFAULT NULL, `sqlpass` varchar(50) DEFAULT NULL, `dir` varchar(50) DEFAULT NULL, `model` varchar(50) DEFAULT 'all', `opentime` varchar(50) DEFAULT NULL, `status` varchar(50) DEFAULT '1', `子目录` varchar(50) DEFAULT '0', `域名数量` varchar(50) DEFAULT '1', `网站空间大小` varchar(50) DEFAULT '100',		  `链接数` varchar(50) DEFAULT '0', `数据库空间大小` varchar(50) DEFAULT '100', `子数据库` varchar(50) NOT NULL DEFAULT '0',		  `带宽限制` varchar(50) DEFAULT '0', `流量限制` varchar(50) DEFAULT '0', `ftp链接数` varchar(50) DEFAULT '0', `ftp上下传速度` varchar(50) DEFAULT '0', `快速登陆key` varchar(50) DEFAULT NULL, `数据库id` varchar(50) DEFAULT NULL, `ftpid` varchar(50) DEFAULT NULL, `siteid` varchar(50) DEFAULT NULL, `是否到期` varchar(50) DEFAULT '0', `是否被暂停` varchar(50) DEFAULT '0', `addtime` varchar(50) DEFAULT '0', `path` varchar(50) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
	//$queryr=$db->query($sqlstr);
	//if (!$queryr || $db->errno > 0)	die(print_r(array('语句执行出错',$db->errno,$db->error,$sqlstr)));
}
function deldir() {
	$xpath1=dirname(__FILE__).'/temp';
	unlink($xpath1.'/domain.conf');
	unlink($xpath1.'/port.pl');
	unlink($xpath1.'/api.json');
	unlink($xpath1.'/default.db');
	rmdir($xpath1.'/');
	rmdir($xpath1);
}

$hqxx=hqxx();
$sqlname = 'BT_DB_USERNAME' ;
$sqlpass = 'BT_DB_PASSWORD' ;
$rootpass=$hqxx[1];
$btkey=q_api();
$ip=q_ip();
$host=q_domain();
$title='HT panel虚拟主机控制面板';
$template='default';
$zsym='.domain.com';
$jxjl='name记录:'.$host.' 或 A记录:'.$ip;
$kzmbdz='ftp://'.$ip.':21';
$btip=q_mb_domain();
$btport=q_mb_port();
$webserver=$hqxx[0];

if($_GET['install']==''){
	$ml= 'cd /www/server/panel;';
	$ml.="rm -rf {$xpath2};";
	$ml.="mkdir -p {$xpath2};";
	$ml.="cp -f data/domain.conf data/port.pl config/api.json data/default.db {$xpath2};";
	$ml.="chmod -R a+r {$xpath3};";
	
	echo "<h1>欢迎</h1>";
	echo "<p>欢迎使用HT panle接下来将消耗您五分钟安装程序！</p>";
	echo "<p>请先在ssh执行这条命令<pre>{$ml}</pre></p>";
	echo '<p><a href="?install=2" class="button button-large"/>开始安装</a></p>';
	echo '<span style="float: right;color:#ccc;font-size:5px;margin:-10px;">感谢WORDPRESS提供安装页面样式</span>';
}

if($_GET['install']=='2'){
	if(!empty($_POST['submit'])){
		
		$cfile=file_get_contents('lib/c.php');
		$apikey=md5(time().rand(10000,99999)+time());
		$cfile=str_replace('[apikey]',$apikey,$cfile);//财务系统与程序通信用的key
		$cfile=str_replace('[btkey]',$_POST['btkey'],$cfile);//和宝塔面板的通信key
		$cfile=str_replace('[sqlname]',$_POST['sqlname'],$cfile);//存放面板数据的数据库信息
		$cfile=str_replace('[sqlpass]',$_POST['sqlpass'],$cfile);//存放面板数据的数据库信息
		$cfile=str_replace('[rootpass]',$_POST['rootpass'],$cfile);//数据库root账号信息
		$cfile=str_replace('[webserver]',$_POST['webserver'],$cfile);//apache or nginx
		$cfile=str_replace('[zsym]',$_POST['zsym'],$cfile);//赠送域名
		$cfile=str_replace('[kzmbdz]',$_POST['kzmbdz'],$cfile);//ftp地址 控制面板上面显示的信息
		$cfile=str_replace('[jxjl]',$_POST['jxjl'],$cfile);//解析记录 在绑定域名那边显示的信息
		$cfile=str_replace('[title]',$_POST['title'],$cfile);//标题栏显示的标题
		$cfile=str_replace('[btip]',$_POST['btip'],$cfile);//
		$cfile=str_replace('[btport]',$_POST['btport'],$cfile);//
		$cfile=str_replace('[template]',$_POST['template'],$cfile);//
		$cfile=str_replace('[adminu]',$_POST['adminu'],$cfile);//
		$cfile=str_replace('[adminp]',$_POST['adminp'],$cfile);//
		$xpz=file_put_contents('lib/conf.php',$cfile);
		if(!$xpz) die('<h1>出现错误了</h1><p>配置文件写出失败,请返回重试</p><p><a href="?install=2" class="button button-large"/>返回</p></a>');
		db_install($_POST['sqlname'],$_POST['sqlpass']);
		deldir();
		unlink('install.php');
		die("<h1>成功！</h1><p>已经配置完成了,请记录您的与财务系统的通讯key</p><p>key:<pre>{$apikey}</pre></p>");
	}
	
	?>
	<form id="setup" method="post" action="?install=2" novalidate="novalidate">

		<input type="hidden" name="form" value="1" />
		<h1>需要信息</h1>
		<p>您需要确认一些基本信息。一般情况下会自动识别,确认信息相符和修改一些信息之后可以点击下一步继续操作。</p>
			<table class="form-table">
				<tr><th scope="row"><label for="weblog_title">面板数据库名</label></th><td><input name="sqlname" type="text" size="25" value="<?=$sqlname;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">面板数据库密码</label></th><td><input name="sqlpass" type="text" size="25" value="<?=$sqlpass;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">数据库root密码</label></th><td><input name="rootpass" type="text" size="25" value="<?=$rootpass;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">宝塔ip或域名</label></th><td><input name="btip" type="text" size="25" value="<?=$btip;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">宝塔端口</label></th><td><input name="btport" type="text" size="25" value="<?=$btport;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">宝塔apikey</label></th><td><input name="btkey" type="text" size="25" value="<?=$btkey;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">服务端类型(nginx还是apache)</label></th><td><input name="webserver" type="text" size="25" value="<?=$webserver;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">ip</label></th><td><input name="ip" type="text" size="25" value="<?=$ip;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">面板域名</label></th><td><input name="host" type="text" size="25" value="<?=$host;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">面板标题</label></th><td><input name="title" type="text" size="25" value="<?=$title;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">默认模板(普通版不支持)</label></th><td><input name="template" type="text" size="25" value="<?=$template;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">赠送域名</label></th><td><input name="zsym" type="text" size="25" value="<?=$zsym;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">解析记录显示</label></th><td><input name="jxjl" type="text" size="25" value="<?=$jxjl;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">ftp地址显示</label></th><td><input name="kzmbdz" type="text" size="25" value="<?=$kzmbdz;?>" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">后台用户名(普通版不支持)</label></th><td><input name="adminu" type="text" size="25" value="admin" /><p></p></td></tr>
				<tr><th scope="row"><label for="weblog_title">后台密码(普通版不支持)</label></th><td><input name="adminp" type="text" size="25" value="admin" /><p></p></td></tr>
				
				
			</table>
		<p class="step"><input type="submit" name="submit" id="submit" class="button button-large" value="下一步"/></p>
	</form>
				
	
<?php	
}